<template>
  <div>
    <!-- 用户操作日志参数模态框 -->
    <a-modal v-model="visible"
             :title="title"
             :width="500"
             :okButtonProps="{props: {disabled: loading}}"
             :maskClosable="false"
             :destroyOnClose="true"
             :cancelButtonProps="{style: {display: 'none'}}"
             @ok="visible = false">
      <a-spin :spinning="loading">
        <a-descriptions title="" layout="horizontal" :column="1">
          <a-descriptions-item label="操作用户ID">{{logParamsObj['_USER_ID_']}}</a-descriptions-item>
        </a-descriptions>
      </a-spin>
    </a-modal>
  </div>
</template>

<script>
  export default {
    name: "EventLogParamModal",
    data() {
      return {
        title: '日志参数',
        visible: false,
        loading: false,
        logParams: '',
      }
    },
    methods: {
      showParams(row) {
        this.visible = true;
        this.logParams = row.paramsJson;
      }
    },
    computed: {
      logParamsObj() {
        if (this.logParams) {
          return JSON.parse(this.logParams);
        } else {
          return {'_USER_ID_': '1'}
        }
      }
    }
  }
</script>

<style scoped>

</style>
